package proxy2;

import java.lang.reflect.Proxy;

public class ProxyTest {
    public static void main(String[] args) {
        Subject realObject=new RealObject();
        ProxyObject proxyObject=new ProxyObject(realObject);
        /**
         *
         */
        Subject subject= (Subject) Proxy.newProxyInstance(realObject.getClass().getClassLoader(),realObject.getClass().getInterfaces(),proxyObject);
        subject.shopping();
        System.out.println(subject.getClass().getName());
    }
}
